package com.office.meeting.situation.controller;

import javax.servlet.http.HttpServletResponse;

import com.office.common.utils.poi.ExcelUtil;
import com.office.meeting.situation.domain.SituationInvitation;
import com.office.meeting.situation.service.SituationService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.office.common.annotation.Log;
import com.office.common.core.controller.BaseController;
import com.office.common.core.domain.AjaxResult;
import com.office.common.enums.BusinessType;
import com.office.common.core.page.TableDataInfo;

import java.util.List;

/**
 * 预约情况Controller
 * 
 * @author ruoyi
 * @date 2025-05-17
 */
@RestController
@RequestMapping("/meeting/situation")
public class SituationController extends BaseController
{
    @Autowired
    private SituationService situationService;

    /**
     * 查询预约情况列表
     */
    @PreAuthorize("@ss.hasPermi('meeting:situation:list')")
    @GetMapping("/list")
    public TableDataInfo list(SituationInvitation conferenceInvitation)
    {
        startPage();
        List<SituationInvitation> list = situationService.selectConferenceInvitationList(conferenceInvitation);
        return getDataTable(list);
    }

    /**
     * 导出预约情况列表
     */
    @PreAuthorize("@ss.hasPermi('meeting:situation:export')")
    @Log(title = "预约情况", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, SituationInvitation conferenceInvitation)
    {
        List<SituationInvitation> list = situationService.selectConferenceInvitationList(conferenceInvitation);
        ExcelUtil<SituationInvitation> util = new ExcelUtil<SituationInvitation>(SituationInvitation.class);
        util.exportExcel(response, list, "预约情况数据");
    }
}
